//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include <elasys_server.h>
#include <driver.h>

//
//  CDeviceDriver
//
PInterface CDeviceDriver::Probe(
    /* [in]  */ REIID riid)
{
    if (riid == EIID_IInterface) {
        return (IInterface *)(IDeviceDriver *)this;
    }
    else if (riid == EIID_IDeviceDriver) {
        return (IDeviceDriver *)this;
    }
    else if (riid == EIID_CLASS_INFO) {
        return (IInterface *)&ECLSID_CDeviceDriver;
    }
    else if (riid == EIID_INTERFACE_INFO) {
        return (IInterface *)&EIID_IDeviceDriver;
    }

    return NULL;
}

UInt32 CDeviceDriver::AddRef(void)
{
    long lRef = m_cRef.Increment();
    return (ulong_t)lRef;
}

UInt32 CDeviceDriver::Release(void)
{
    long lRef = m_cRef.Decrement();
    if (0 == lRef) {
        Dispose();
    }
    return (ulong_t)lRef;
}

ECode CDeviceDriver::Aggregate(
    /* [in] */ AggrType aggrType,
    /* [in] */ PInterface pObject)
{
    return E_NOT_IMPLEMENTED;
}

ECode CDeviceDriver::GetDomain(
    /* [out] */ PInterface *ppObj)
{
    return E_NOT_IMPLEMENTED;
}

